/**
 * MemberProfileService.java
 * 
 * Copyright@2015 OVT Inc. All rights reserved. 
 * 
 * Dec 28, 2015
 */
package com.ovt.doorbell.payment.service;

import com.ovt.doorbell.payment.dao.constant.PurchaseType;
import com.ovt.doorbell.payment.dao.vo.FullMemberProfile;
import com.ovt.doorbell.payment.dao.vo.MemberProfile;
import com.ovt.doorbell.payment.service.exception.ServiceException;


/**
 * MemberProfileService
 * 
 * @Author zhi.liu
 * @Version 1.0
 * @See 
 * @Since [OVT Cloud Platform]/[API] 1.0
 */
public interface MemberProfileService
{
    
    /**
     * Get member profile.
     * 
     * @param userId
     * @return
     */
    MemberProfile getMemberProfile(String userId) throws ServiceException;
    
    /**
     * Get member profile include resource used info.
     * Based on agreement with [DoorBell User Resource Controller Server], 
     * they will return all requested information.
     * 
     * @param userId
     * @return
     */
    FullMemberProfile getFullMemberProfile(String userId) throws ServiceException;

    /**
     * @param oldMemberProfile
     * @param purchase
     */
    void saveProfile(MemberProfile memberProfile, PurchaseType purchaseType) throws ServiceException;
    
    /**
     * Prepare cancel member profile info.
     * 
     * @param userId
     */
    FullMemberProfile preCancelProfile(String userId) throws ServiceException;
    
    /**
     * Cancel member profile.
     * 
     * @param userId
     * @return refund request form id.
     */
    long cancelProfile(String userId) throws ServiceException;
    
    /**
     * Get purchase type according current profile.
     * 
     * @param memberProfile
     * @return
     * @throws ServiceException
     */
    PurchaseType getPurchaseType(MemberProfile memberProfile) throws ServiceException;
    
}
